import { axios } from '@/utils/request'

const api = {
  userList: '/adminapi/user/userlist',
  studentList: '/adminapi/user/studentList',
  userDetail: '/adminapi/user/userdetail',
  userEdit: '/adminapi/user/useredit',
  userGroupList: '/adminapi/user/userGroupList',
  setPassword: '/adminapi/user/setPassword',
  userOptions: '/adminapi/user/userOptions',
  editPassword: '/adminapi/user/editPassword',
  teacherList: '/adminapi/user/teacherList',
}

export default api

export function getUserList(parameter) {
  return axios({
    url: api.userList,
    method: 'get',
    params: parameter
  })
}
export function getStudentList(parameter) {
  return axios({
    url: api.studentList,
    method: 'get',
    params: parameter
  })
}
export function getTeacherList(parameter) {
  return axios({
    url: api.teacherList,
    method: 'get',
    params: parameter
  })
}

export function editPassword(parameter) {
  return axios({
    url: api.editPassword,
    method: 'post',
    data: parameter
  })
}
export function getUserDetail(parameter) {
  return axios({
    url: api.userDetail,
    method: 'get',
    params: parameter
  })
}

export function editUser(parameter) {
  return axios({
    url: api.userEdit,
    method: 'post',
    data: parameter
  })
}

export function getUserGroupList(parameter) {
  return axios({
    url: api.userGroupList,
    method: 'get',
    params: parameter
  })
}
export function setPassword(parameter) {
  return axios({
    url: api.setPassword,
    method: 'get',
    params: parameter
  })
}


export function getUserOptions(parameter) {
  return axios({
    url: api.userOptions,
    method: 'get',
    params: parameter
  })
}

